import matplotlib.pyplot as plt
import pandas as pd
plt.rcParams['svg.fonttype'] = 'none'

# 创建数据框架
data = {
    'Round': [10, 20, 30, 40, 50, 60, 70, 80],
    'SPS': [0.4752018278985544,
  0.5522959362973934,
  0.5919633660507616,
  0.5709591845835761,
  0.5965369982941922,
  0.5820688367902236,
  0.5800796742044834,
  0.608277390226282],
 'OGS': [0.5495003629167824,
  0.7756700918289768,
  0.8376846112030305,
  0.8549549863143139,
  0.877744036847581,
  0.8758695975386571,
  0.8892809353746628,
  0.9009895209409363],
 'ORDP': [0.6245120754318005,
  0.6598873179247013,
  0.6300746624685624,
  0.6333914203159536,
  0.6279087520724126,
  0.6000679847612364,
  0.6077801593006377,
  0.6156406882769848]
}

df = pd.DataFrame(data)

# 绘制数据
plt.figure(figsize=(8, 6))
plt.plot(df['Round'], df['SPS'], marker='s', markersize=10, label='SPS')
plt.plot(df['Round'], df['OGS'], marker='^', markersize=10, label='OGS')
plt.plot(df['Round'], df['ORDP'], marker='*', markersize=10, label='ORDP')

# plt.title('Comparison of SPF and Cplex Algorithms')
plt.xlabel('Avg. Link Capacity', fontsize=14)
plt.ylabel('Jain\'s Index', fontsize=14)
plt.legend(fontsize='large')  # 设置图例的字体大小为大

plt.grid(True)
# plt.show()
plt.savefig("output/jain_var_capacity.svg", format="svg")
